import { configureStore } from "@reduxjs/toolkit"
import yzh from "./modules/yzh"
import { persistStore, persistReducer } from 'redux-persist';
import storage from 'redux-persist/lib/storage';

const persistConfigYzh = {
    key: 'yzh',
    storage,
    whitelist: ['activeIndex'] // 只持久化 activeIndex 
};
const persistedReducerYzh = persistReducer(persistConfigYzh, yzh);

export const store = configureStore({
    reducer: {
        yzh: persistedReducerYzh,
    },
    middleware: (getDefaultMiddleware) =>
        getDefaultMiddleware({
            serializableCheck: false
        })
})
export const persistor = persistStore(store)